package com.ruoyi.taskSys.service.impl;

import java.util.List;

import com.ruoyi.taskSys.domain.SMSTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.taskSys.mapper.MHouseholdTaskMapper;
import com.ruoyi.taskSys.domain.MHouseholdTask;
import com.ruoyi.taskSys.service.IMHouseholdTaskService;

/**
 * 住户核酸任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-28
 */
@Service
public class MHouseholdTaskServiceImpl implements IMHouseholdTaskService 
{
    @Autowired
    private MHouseholdTaskMapper mHouseholdTaskMapper;

    /**
     * 查询住户核酸任务
     * 
     * @param id 住户核酸任务主键
     * @return 住户核酸任务
     */
    @Override
    public MHouseholdTask selectMHouseholdTaskById(Long id)
    {
        return mHouseholdTaskMapper.selectMHouseholdTaskById(id);
    }

    /**
     * 查询住户核酸任务列表
     * 
     * @param mHouseholdTask 住户核酸任务
     * @return 住户核酸任务
     */
    @Override
    public List<MHouseholdTask> selectMHouseholdTaskList(MHouseholdTask mHouseholdTask)
    {
        return mHouseholdTaskMapper.selectMHouseholdTaskList(mHouseholdTask);
    }

    /**
     * 新增住户核酸任务
     * 
     * @param mHouseholdTask 住户核酸任务
     * @return 结果
     */
    @Override
    public int insertMHouseholdTask(MHouseholdTask mHouseholdTask)
    {
        return mHouseholdTaskMapper.insertMHouseholdTask(mHouseholdTask);
    }

    /**
     * 修改住户核酸任务
     * 
     * @param mHouseholdTask 住户核酸任务
     * @return 结果
     */
    @Override
    public int updateMHouseholdTask(MHouseholdTask mHouseholdTask)
    {
        return mHouseholdTaskMapper.updateMHouseholdTask(mHouseholdTask);
    }

    /**
     * 批量删除住户核酸任务
     * 
     * @param ids 需要删除的住户核酸任务主键
     * @return 结果
     */
    @Override
    public int deleteMHouseholdTaskByIds(Long[] ids)
    {
        return mHouseholdTaskMapper.deleteMHouseholdTaskByIds(ids);
    }

    /**
     * 删除住户核酸任务信息
     * 
     * @param id 住户核酸任务主键
     * @return 结果
     */
    @Override
    public int deleteMHouseholdTaskById(Long id)
    {
        return mHouseholdTaskMapper.deleteMHouseholdTaskById(id);
    }

    @Override
    public String sendMessage(Long id) {
        String phone=mHouseholdTaskMapper.selectUserPhone(id);
        SMSTemplate smsTemplate=new SMSTemplate();
        smsTemplate.sendMessage(phone,"兄弟，该做核酸了！");
        return null;
    }
}
